/**
 * 
 */
package fr.ants.view.panel;

import java.awt.Dimension;

import javax.swing.BoxLayout;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;

import fr.ants.controller.listener.ButtonsListener;
import fr.ants.view.HMI;
import fr.ants.view.Renderer;

/**
 * @author Guillaume Ruscassie
 * 
 */
public class RendererPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 5544935384933664468L;
	/**
	 * title of the renderer.
	 */
	private final JLabel rendererLabel;
	/**
	 * combobox to select the renderer.
	 */
	private final JComboBox<String> rendererComboxBox;

	/**
	 * Build.
	 * @param buttonsListener 
	 */
	public RendererPanel(ButtonsListener buttonsListener) {
		setLayout(new BoxLayout(this, BoxLayout.X_AXIS));

		rendererLabel = new JLabel(HMI.RENDERER);
		rendererLabel.setAlignmentX(CENTER_ALIGNMENT);
		rendererLabel.setMaximumSize(new Dimension(100, 20));
		//add(rendererLabel, BorderLayout.CENTER);
		this.add(rendererLabel);
		

		// renderer
		final String[] valuesCombo = { Renderer.POKEMON.getLabel(), Renderer.RELIEF.getLabel(), Renderer.GRIS.getLabel()  };
		rendererComboxBox = new JComboBox<String>(valuesCombo);
		rendererComboxBox.setAlignmentX(CENTER_ALIGNMENT);
		rendererComboxBox.setMaximumSize(new Dimension(100, 20));
		//add(rendererComboxBox, BorderLayout.SOUTH);
		this.setMaximumSize(new Dimension(1000, 20));
		this.add(rendererComboxBox);
		rendererComboxBox.addActionListener(buttonsListener);
	}
}
